<template>
  <div id="app">
      <ul>
        <li v-for="(item,index) in arr" :key="index">{{item}}</li>
      </ul>
      <button @click="fn">走一走</button>
  </div>
</template>

<script>
export default {
  data(){
    return{
      arr:['帅哥','美女','程序猿'] //数组用冒号
    }
  },
  methods:{
    fn(){
      this.arr.push(this.arr[0]); //头部数据添加到末尾
      this.arr.shift() //删除头部数据
    }
  }
  
};
</script>

<style>
</style>
